/**
 * Copyright(c) 2013 Jade Techonologies Co., Ltd.
 *
 * History:
 *   13-7-11 上午11:08 Created by sky
 */
package com.jade.modules.message.sms;

/**
 * 抽象的短信客户端。
 *
 * @author sky
 * @version 1.0 13-7-11 上午11:08
 */
public abstract class AbstractSmsClient
        implements SmsClient
{
    protected SmsListener smsListener;

    public abstract SmsResult send(SmsMessage message, SmsServiceParams params);

    public SmsResult[] send(SmsMessage[] smses, SmsServiceParams params)
    {
        SmsResult[] results = new SmsResult[smses.length];
        for (int i = 0; i < smses.length; i++) {
            results[i] = send(smses[i], params);
        }
        return results;
    }

    public void close()
    {
        // do nothing
    }

    public boolean isReadable()
    {
        return false;
    }

    public boolean isWritable()
    {
        return true;
    }

    public void setMessageListener(SmsListener listener)
    {
        this.smsListener = listener;
    }
}
